package com.wwf.controller;

import com.wwf.util.EmailUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wwf
 * @date 2021年02月08日 15:10:10
 */
@RestController
@RequestMapping("/email")
public class EmailController {


    /**
     *
     * @param email 邮箱
     * @param code 验证码
     * @return
     */
    @RequestMapping("/{email}/{code}")
    public String email(@PathVariable("email") String email, @PathVariable("code") String code){
        String mailServer="smtp.qq.com";
        String loginAccount="2936283507@qq.com";
        String loginAuthCode="ofsztdsnvyuhdfeh";
        String sender = "2936283507@qq.com";
        int rs = EmailUtils.sendEmail(mailServer, loginAccount, loginAuthCode, sender, new String[]{email}, "登录验证码", code, "text/html;charset=utf-8");
        return "1";
    }
}
